<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>ssm整合</title>
</head>
<body>
<h1>成功</h1>
<table border="1" cellpadding="5" cellspacing="0">
    <tr>
        <th>id</th>
        <th>name</th>
        <th>course</th>
        <th>address</th>
    </tr>
    <c:forEach items="${pageInfo.list}" var="teacher">
        <tr>
            <td>${teacher.id}</td>
            <td>${teacher.name}</td>
            <td>${teacher.course}</td>
            <td>${teacher.address}</td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="4">
            <a href="${pageContext.request.contextPath}/getTeachers?pageNumber=1">首页</a>
            <a href="${pageContext.request.contextPath}/getTeachers?pageNumber=${pageInfo.prePage}">上一页</a>
            <c:forEach items="${pageInfo.navigatepageNums}" var="pageNumber">
                <c:choose>
                    <c:when test="${pageNumber == pageInfo.pageNum}">
                        【${pageNumber}】
                    </c:when>
                    <c:otherwise>
                        <a href="${pageContext.request.contextPath}/getTeachers?pageNumber=${pageNumber}">${pageNumber}</a>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
            <a href="${pageContext.request.contextPath}/getTeachers?pageNumber=${pageInfo.nextPage}">下一页</a>
            <a href="${pageContext.request.contextPath}/getTeachers?pageNumber=${pageInfo.pages}">末页</a>
        </td>
    </tr>
</table>
</body>
</html>